<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <h:form id="equipeForm" enctype="multipart/form-data">
                <br/>
                <h3 class="title">Atualizando Equipe</h3>
                <p:growl id="messages" showDetail="true" autoUpdate="true"  /> 
                <p:panel id="dadosPanel" style="background: none; border: none;" 
                         styleClass="container_24 clearfix both ">
                    <h4 class="title">Dados Gerais</h4>
                    <p:outputLabel value="Código IES:" styleClass="grid_3" for="codigoInputText" />
                    <p:inputText id="codigoInputText" styleClass="grid_8" readonly="true" 
                                 value="#{ managerEditarEquipe.equipeVisualizar.codigo }" />
                    <div class="clear"/>

                    <p:outputLabel value="Unidade:" styleClass="grid_3" for="unidadeInputText" />
                    <p:inputText id="unidadeInputText" styleClass="grid_20" readonly="true"
                                    value="#{managerEditarEquipe.equipeVisualizar.unidade.nome.concat(' / CNES - ').concat(managerEditarEquipe.equipeVisualizar.unidade.codigoCNES)}"/>
                    <div class="clear-both"/>

                    <p:outputLabel value="Nome:" styleClass="grid_3" for="nomeInputText" />
                    <p:inputText id="nomeInputText" styleClass="grid_19" readonly="true"
                                 value="#{ managerEditarEquipe.equipeVisualizar.nome }" />

                    <p:outputLabel value="Descrição:" styleClass="grid_3" for="descInputText" />
                    <p:inputTextarea id="descInputText" styleClass="grid_19" readonly="true"
                                     value="#{ managerEditarEquipe.equipeVisualizar.descricao }" />
                    <div class="clear"/>

                </p:panel>
                <p:panel id="profissionalPanel" style="background: none; border: none;" 
                         styleClass="container_24 clearfix both ">
                    <h4 class="title">Adicionando Profissionais</h4>

                    <p:dataTable id="profissionalTable" var="item" value="#{managerEditarEquipe.profissionaisSelecionados}" 
                                 styleClass="grid_24" rowIndexVar="rowid"                 
                                 rows="5" paginator="true" lazy="true"    
                                 paginatorTemplate="{FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
                                 currentPageReportTemplate="{currentPage} de {totalPages}"
                                 paginatorPosition="bottom" emptyMessage="Nenhum registro encontrado"
                                 style="white-space: pre-wrap;">

                        <f:facet name="header">
                            <p:outputLabel value="Profissional" />
                        </f:facet> 
                        <p:column headerText="Nome" width="400">  
                            <h:outputText value="#{item.nome}" />

                        </p:column>
                        <p:column headerText="Numero SUS">  
                            <h:outputText value="#{item.numeroCartaoSus}"/>
                        </p:column> 
                        <p:column headerText="CPF ">  
                            <h:outputText value="#{item.cpf}"/>
                        </p:column> 

                    </p:dataTable> 

                </p:panel>

                <br/>
                <div class="buttonAction">

                    <p:button href="pesquisarequipe.xhtml" value="Cancelar"  icon="ui-icon-trash" />
                </div >




            </h:form>
        </ui:define>
    </ui:composition>

</html>
